Skip to content

refactor: optimize watcher and improve thread-safety#17

Merged
devspexx merged 4 commits into
masterfrom
refactor/watcher-optimization
Apr 6, 2026
Merged

refactor: optimize watcher and improve thread-safety#17
devspexx merged 4 commits into
masterfrom
refactor/watcher-optimization

Conversation

@devspexx
Copy link
Copy Markdown
Owner

@devspexx devspexx commented Apr 6, 2026

Summary

Improves the configuration watcher implementation and internal handling.

Changes

  • Replaced O(n) directory lookup with O(1) WatchKey → Path mapping
  • Added proper WatchKey cleanup to prevent memory leaks
  • Improved thread-safety (volatile usage for cached state)
  • Reduced redundant operations in watcher loop
  • Minor code cleanup and consistency improvements

Notes

  • No API changes
  • No behavior changes
  • Internal refactor only

@devspexx devspexx merged commit b89f77e into master Apr 6, 2026
2 checks passed
@devspexx devspexx deleted the refactor/watcher-optimization branch April 6, 2026 19:10
@devspexx devspexx added Documentation Improvements or additions to documentation, comments, or examples. Enhancement An improvement to existing functionality without changing its core behavior. labels Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation, comments, or examples. Enhancement An improvement to existing functionality without changing its core behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants